<? 
require_once("Clases/Alumno.php");
require_once("Clases/Docente.php");
require_once("Clases/Reporte.php");
require_once "Excel/Classes/PHPExcel/IOFactory.php";
include "leerReporte.php";
set_time_limit(0);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SRP | Cargar Archivo Reportes</title>
    <link href="font/stylesheet.css" rel="stylesheet" type="text/css" media="all" />
    <script src="js/jquery.uniform.js" type="text/javascript" charset="utf-8"></script>
    <!-- Include this jQuery library in your HTML somewhere: -->
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
    <!-- jQuery -->
    <link rel="stylesheet" href="css/uniform.default.css" type="text/css" media="screen" />
    <link href="css/stylese.css" rel="stylesheet" type="text/css" media="all" />
    </head>

    <body>

<div id="login">
</br>
</br>
</br>
    <h1 style="color:#FFF; text-align: center; font-size:30px; alignment-adjust: central">CARGAR ARCHIVO REPORTES SRP</h1>
      <div id="log-Sup">
    <div id="logWrap">
          
       
    </br>  
    </br>  
    </br>
    
    <h1>
    </br>
    <form action="cargarReportes.php"
enctype="multipart/form-data" method="post">
<input type="file" accept="excel/*" runat="server" name="uploadedfile" size="40" />
</br>
</br>
<input type="submit" class="blueButton" value="Enviar">


</form>
<div id="progressbarCh" style="margin-top: 120px">
    <div id="indicator"></div>
</div>
<div id="progressnum" style="font-size: 16px"></div>
    </h1>
        </div>
  </div>
   

      <div class="push"></div>
      
    </div>
<div id="foot">
      <p>© SRP</p>
    </div>
           
</body>
        <?
if($_FILES['uploadedfile']==null)
        {
        ?>
    <script>
        document.getElementById("progressbarCh").style.visibility = "hidden";
        document.getElementById("progressnum").style.visibility = "hidden";
    </script>
            <?
                
        }
        else
            {
            $path_parts = pathinfo($_FILES['uploadedfile']["name"]);
            $ext = $path_parts['extension'];
            if($ext!="xls")
            {
                
                ?>
                    <script>
                        alert("Error: El Archivo Excel tiene que tener una extension del tipo .xls");
                        </script>
                    <?
                    
            }
            else{
            ?>
    <script>
        document.getElementById("progressbarCh").style.visibility = "visible";
        document.getElementById("progressnum").style.visibility = "visible";
    </script>
            <?
            $target_path = "Excel/DatosAlumnos.xls";
             if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
                pollo();
            }
        }
            }
        ?>
</html>

